﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScaffoldIt
{
    public class ScaffoldingError
    {
        public string TemplateFile { get; set; }

        public bool Warning { get; set; }

        public string Message { get; set; }

        public int? Line { get; set; }

        public int? Column { get; set; }

        private const string ErrorStr = "ERROR : ";
        private const string WarnStr = "WARNING : ";
        public override string ToString()
        {
            var res = ErrorStr;
            if (Warning) res = WarnStr;

            if (Line.HasValue || Column.HasValue)
            {
                res += "on line " + Line + " column " + Column + " \r\n" + Message;
            }
            else
            {
                res += Message;
            }

            return res;
        }
    }
}
